﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.CUiAPPLegacyAutomaticPathPlannerCmd
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using DnProcessSimulateCommands.AutomaticPathPlanner;
using EngineeringInternalExtension;
using System.Resources;
using System.Windows;
using System.Windows.Forms;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands;

[TxPowerEngineeringCommandCategory]
public class CUiAPPLegacyAutomaticPathPlannerCmd : CUiAPPAutomaticPathPlannerCmd
{
  private CUiAPPLegacyAutomaticPathPlannerCmdEnabler m_enabler;

  public CUiAPPLegacyAutomaticPathPlannerCmd()
  {
    this.m_enabler = new CUiAPPLegacyAutomaticPathPlannerCmdEnabler();
  }

  public override void Execute(object cmdParams)
  {
    if (this.GetLicense())
    {
      Cursor current = Cursor.Current;
      Cursor.Current = Cursors.WaitCursor;
      CUiAPPMainWindow cuiAppMainWindow = new CUiAPPMainWindow((CUiAPPAutomaticPathPlannerCmd) this);
      ((Window) cuiAppMainWindow).Title = StringTable.AUTO_PATH_PLAN_TITLE;
      if (cuiAppMainWindow.ShouldBeStarted)
        ((Window) cuiAppMainWindow).Show();
      else
        ((Window) cuiAppMainWindow).Close();
      Cursor.Current = current;
    }
    else
      TxMessageBoxEx.ShowNoLicenseError(base.Name);
  }

  public override string Category
  {
    get
    {
      return new ResourceManager("DnProcessSimulateCommands.StringTable", ((object) this).GetType().Assembly).GetString("AUTO_PATH_PLAN_CATEGORY");
    }
  }

  public override string Name
  {
    get
    {
      return new ResourceManager("DnProcessSimulateCommands.StringTable", ((object) this).GetType().Assembly).GetString("AUTO_PATH_PLAN_NAME");
    }
  }

  public override string Bitmap => "AutomaticPathPlanner.res.AutoPathPlan.bmp";

  public override string LargeBitmap => "AutomaticPathPlanner.res.AutoPathPlan_LARGE.png";

  public override ITxImage Image => (ITxImage) Images.AutomaticPathPlanner;

  public override string Tooltip
  {
    get
    {
      return new ResourceManager("DnProcessSimulateCommands.StringTable", ((object) this).GetType().Assembly).GetString("AUTO_PATH_PLAN_TOOLTIP");
    }
  }

  public override string Description
  {
    get
    {
      return new ResourceManager("DnProcessSimulateCommands.StringTable", ((object) this).GetType().Assembly).GetString("AUTO_PATH_PLAN_DESCRIPTION");
    }
  }

  public override bool Connect() => true;

  public override ITxCommandEnabler CommandEnabler => (ITxCommandEnabler) this.m_enabler;

  private bool GetLicense() => TxCommandLicenser.AutomaticPathPlannerLicence;
}
